﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.DAL;
using MINERP.MODEL.FoundationModel;

namespace MINERP.BLL.PhotoRindGrid
{
    public class GridView
    {
        /// <summary>
        /// 格子信息
        /// </summary>
        public Grid_Info PhotoGridInfo { get; set; }
         /// <summary>
        /// 定单产品信息orderInfo
        /// </summary>
        public OrderInfo_Info  OrderProductInfo { get; set; }//
        /// <summary>
        /// 定单包信息
        /// </summary>
        public Tb_OrderBag_Info OrderBagInfo { get; set; }//
        /// <summary>
        /// 产品信息
        /// </summary>
        public Tb_Product_Info ProductInfo { get; set; }
        /// <summary>
        /// 商户信息
        /// </summary>
        public Shop_Info ShopInfo { get; set; }
        /// <summary>
        /// 分区信息
        /// </summary>
        public GridSubArea_Info SubAreaInfo { set; get; }

        public DateTime FristEnterTime
        {
            get
            {
                return PhotoGridInfo.FirstEnterTime;
            }
        }
        public int ProductId
        {
            get
            {
                if (OrderProductInfo != null)
                    return OrderProductInfo.OrderProductId;
                else
                {
                    return 0;
                }
            }
        }
        public int GridId
        {
            get
            {
                if (PhotoGridInfo != null)
                {
                    return PhotoGridInfo.GridId;
                }
                else
                {
                    return 0;
                }
            }
           
        }
        public string GridName
        {
            get { 
                if (PhotoGridInfo!=null)
                return PhotoGridInfo.GridName;
                else
                {
                    return "";
                }
            }
        }
        public string OrderBagName
        {
            get
            {
                if (OrderBagInfo!=null)
                    return OrderBagInfo.BagName;
                else
                {
                    return "";
                }
            }

        }

        public string ProductName
        {
            get
            {
                if (OrderProductInfo != null)
                    return OrderProductInfo.OrderProductName;
                else
                    return "";
            }
        }
        public int Count { set; get; }
        public int Curr { set; get; }
        public int PageNum
        {
            get {
                if (OrderProductInfo != null)
                {
                    return OrderProductInfo.ProductNum;
                }
                else
                {
                    return 0;
                }
            }
        }
        public string ShopName
        {
            get;
            set;
            //get
            //{
            //    if (ShopInfo!=null)
            //        return ShopInfo.ShopName;
            //    else
            //    {
            //        return "";
            //    }
            //}
          
        }
        public string CustomerName
        {
            get
            {
                if (OrderProductInfo!=null)
                    return OrderProductInfo.CtmName;
                else
                {
                    return "";
                }
            }
        }
        public string SubName
        {
            get
            {
                if (SubAreaInfo != null)
                {
                    return SubAreaInfo.SubAreaName;
                }
                else
                {
                    return "";
                }
            }
        }
        public string BagCode
        {
            get
            {
                if (OrderBagInfo!=null) 
                    return OrderBagInfo.BagCode;
                else
                {
                    return "";
                }
            }
        }
    }
    public class PhotoView
    {
        /// <summary>
        /// 照片信息
        /// </summary>
        public PhotoInfo_Info PhotoInfo { set; get; }
        
        
        
        
        /// <summary>
        /// 纸型信息
        /// </summary>
        public PaperType_Info PaperTypeInfo
        {
            get; set;
        }
      
        /// <summary>
        /// 纸面信息
        /// </summary>
        public PaperFace_Info PaperFaceInfo
        {
            get; set;
        }

        public GridRecord_Info GridRecordInfo { get; set; }
        public string PrinterName { get; set; }
        public int photoId
        {
            get { return PhotoInfo.PhotoId; }
        }
        public string PaperFace
        {
            get { return PaperFaceInfo.Name; }
        }
        public string PaperType
        {
            get { return PaperTypeInfo.Name; }
        }
        public string Size
        {
            get { return PhotoInfo.Width + "×" + PhotoInfo.Height;}
        }
        public string PhotoName
        {
            get { return PhotoInfo.PhotoName; }
        }
        public string PhotoBarCode
        {
            get
            {
                return PhotoInfo.PhotoBarCode;
            }
        }
        public int  Status
        {
            get { return PhotoInfo.Status; }
        }
        public int Num
        {
            get
            {
                return GridRecordInfo==null?0:GridRecordInfo.Num;
            }
        }
        public int TotalNum
        {
            get
            {
                return PhotoInfo.TotalNum;
            }
        }
        public string PicPath
        {
            get
            {
                return PhotoInfo.PicPath;
            }
        }
        public bool isCheck
        {
            get;
            set;
        }
       
    }
    public class ReportView
    {
        /// <summary>
        /// 定单信息
        /// </summary>
        Tb_OrderBag_Info OrderBagInfo{get; set;}
        /// <summary>
        /// 产品信息
        /// </summary>
        OrderInfo_Info OrderInfoInfo { get; set; }
        /// <summary>
        /// 照片信息
        /// </summary>
        PhotoInfo_Info PhoTOInfoInfo { get; set; }
        /// <summary>
        /// 流程信息
        /// </summary>
        WorkOrderFlowList_Info WorkOrderFlowListInfo { get; set; }
    }
    public class ProductPhotoView
    {
        /// <summary>
        /// 照片信息
        /// </summary>
        public PhotoInfo_Info PhotoInfo { set; get; }


        ///产品信息
        public OrderInfo_Info orderProduct { get; set; }

        /// <summary>
        /// 纸型信息
        /// </summary>
        public PaperType_Info PaperTypeInfo
        {
            get;
            set;
        }

        /// <summary>
        /// 纸面信息
        /// </summary>
        public PaperFace_Info PaperFaceInfo
        {
            get;
            set;
        }

    
        public string PrinterName { get; set; }

        public string PaperFace
        {
            get { return PaperFaceInfo.Name; }
        }
        public string PaperType
        {
            get { return PaperTypeInfo.Name; }
        }
        public string Size
        {
            get { return PhotoInfo.Width + "×" + PhotoInfo.Height; }
        }
        public string PhotoName
        {
            get { return PhotoInfo.PhotoName; }
        }
        public string PhotoBarCode
        {
            get
            {
                return PhotoInfo.PhotoBarCode;
            }
        }
        public int Status
        {
            get { return PhotoInfo.Status; }
        }
     
      
        public string PicPath
        {
            get
            {
                return PhotoInfo.PicPath;
            }
        }
    }


}
